//
//  LDFinderWorthCollectionCell.swift
//  DingDongZP
//
//  Created by 三秒文化 on 16/5/22.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

import UIKit

class LDFinderWorthCollectionCell: UICollectionViewCell {
    

    var imgurl:String?
    var title:String? {
        
        didSet{
        
            labTitle?.text = title ?? ""
        }
    }
    var iconName:String = "" {
        
        didSet{
            
            imgView?.sd_setImageWithURL(NSURL.init(string: iconName), placeholderImage: UIImage(named: "actionbar_picture_icon"))
        }
    }
    
    private var imgView:UIImageView?
    private var labTitle:UILabel?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        backgroundColor = UIColor.whiteColor()
        
        imgView = UIImageView()//UIImageView(image: UIImage(named: "icon_communicate"))
        labTitle = UILabel.setDetailsLab(title, fontSize: 13, titleColor: LDFontColor.LightBlack, Alignment: .Center)
        
        addSubview(imgView!)
        addSubview(labTitle!)
        
        imgView?.snp_makeConstraints(closure: { (make) in
            
            make.top.equalTo(25)
            make.centerX.equalTo(0)
            make.size.equalTo(CGSizeMake(35, 35))
        })
        
        labTitle?.snp_makeConstraints(closure: { (make) in
            
            make.top.equalTo((imgView?.snp_bottom)!).offset(LDMargin_V*2.2)
            make.left.right.equalTo(0)
            make.height.equalTo(15)
        })
        
//        layer.borderWidth = 0.26
//        layer.borderColor = LDIconColor.LightGray.CGColor//UIColor.grayColor().CGColor
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
